From 7c21394c4175c36df57e4639bc29f40bc7e7d792 Mon Sep 17 00:00:00 2001 From: Andrew Garrett Date: Wed, 29 Nov 2006 06:56:18 +0000 Subject: [PATCH] *Automatically pre-fill the edit-summary field when undoing an edit.*Add a message at the top of the edit page when undoing an edit. This gives the user some feedback that their undo actually worked, rather than just directed them to an edit page. (Unless you actually look, there's no evidence of a successful undo, which could confuse users) --- includes/EditPage.php | 6 +++++- languages/messages/MessagesEn.php | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/includes/EditPage.php b/includes/EditPage.php index f655c5b9df..8cad492656 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -119,6 +119,10 @@ class EditPage { #Give a warning $this->editFormPageTop .= "

" . wfMsg('undofailed') . "

\n" . '

'.wfMsg('explainundofailed').'

'; + } else { + $this->editFormPageTop .= '

'.wfMsg('undosucceeded')."

\n" . + '

'.wfMsg('explainundosucceeded').'

'; + $this->summary = wfMsgForContent('undo-summary', $undo, $undorev->getUserText()); } } } @@ -844,8 +848,8 @@ class EditPage { */ function initialiseForm() { $this->edittime = $this->mArticle->getTimestamp(); - $this->textbox1 = $this->getContent(); $this->summary = ''; + $this->textbox1 = $this->getContent(); if ( !$this->mArticle->exists() && $this->mArticle->mTitle->getNamespace() == NS_MEDIAWIKI ) $this->textbox1 = wfMsgWeirdKey( $this->mArticle->mTitle->getText() ) ; wfProxyCheck(); diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 6514ff5b00..2ff707c726 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -999,6 +999,9 @@ the text into a text file and save it for later.', You can go back and edit an existing page, or [[Special:Userlogin|log in or create an account]].', 'undofailed' => 'Undo Failed', 'explainundofailed' => 'The edit could not be undone because of conflicting intermediate edits. Please manually undo the edits.', +'undosucceeded' => 'Undo Succeeded', +'explainundosucceeded' => 'The edit was successfully undone. Please click save to apply this change.', +'undo-summary' => 'Undo revision $1 by [[Special:Contributions/$2]] ([[User talk:$2]])', # Account creation failure 'cantcreateaccounttitle' => 'Can\'t create account', -- 2.20.1